package org.maiyodemo.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.maiyodemo.db.MaiyoDemoDB;
import org.maiyodemo.entity.Cat;
import org.maiyodemo.entity.User;

public class UserSvcImpl implements UserSvc {

	public List<Cat> getCatByUser(User user) {
		return MaiyoDemoDB.catDao.get(user);
	}

	public Map<String, Cat> getAllCats() {
		Map<String, Cat> stringCats = new HashMap<String, Cat>();
		int i = 1;
		for (List<Cat> cats : MaiyoDemoDB.catDao.values()) {
			for (Cat cat : cats) {
				stringCats.put("第" + i++ + "个", cat);
			}
		}
		return stringCats;
	}

}
